import { IUserProfile } from '@/store/reducer/user';
import request from '@/utils/request';

export const getUserInfoAPI = () => {
  return request({ url: '/v1_0/user' });
};

export const getUserProfileAPI = () => {
  return request({ url: '/v1_0/user/profile' });
};

export const updatePhotoAPI = (formData: FormData) => {
  return request({ url: '/v1_0/user/photo', method: 'patch', data: formData });
};

// 1. Partial把对象所有键转为可选
export const updateProfileAPI = (data: Partial<IUserProfile>) => {
  return request({ url: '/v1_0/user/profile', method: 'patch', data: data });
};
